<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'account.label', default: 'account')}"/>
    <title>testPage</title>
    <!-- 智慧楼盘css -->
    <asset:stylesheet src="intelligence/material-design-iconic-font.min.css"/>
    <asset:stylesheet src="intelligence/animate.min.css"/>
    <asset:stylesheet src="intelligence/jquery.scrollbar.css"/>
    <asset:stylesheet src="intelligence/fullcalendar.min.css"/>
    <!-- 此样式与homer样式冲突 -->
    <asset:stylesheet src="intelligence/app.min.css"/>
    <asset:stylesheet src="intelligence/demo.css"/>
    <asset:stylesheet src="intelligence/jquery-ui.css"/>
    <asset:stylesheet src="intelligence/style.css"/>
    <asset:stylesheet src="intelligence/reset.css"/>

    <style>
        /*页面高度*/
        #wrapper{
            min-height: 0;
            position: inherit;
        }
        /*nav高度*/
        .navLeftlog{
            height: 56px;
        }
    html,body,#mapDiv{
      padding: 0;
      margin: 0;
      height: 100%;
      width: 100%;
    }
    [data-columns]::before{display:block;visibility:hidden;position:absolute;font-size:1px;}

    .jqstooltip {
        position: absolute;
        left: 0px;
        top: 0px;
        visibility: hidden;
        background: rgb(0, 0, 0) transparent;
        background-color: rgba(0,0,0,0.6);
        filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);
        -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";
        color: white;
        font: 10px arial, san serif;
        text-align: left;
        white-space: nowrap;padding: 5px;
        border: 1px solid white;
        z-index: 10000;
    }

    .jqsfield{color: white;font: 10px arial, san serif;text-align: left;}

    [data-ma-theme=green] .header, [data-ma-theme=green] .login__block__btn, [data-ma-theme=green] .login__block__header{
        background: #2196F3;
        position: absolute;
    }
    [data-ma-theme=green] .navigation__active:before, [data-ma-theme=green] .navigation__active>a, [data-ma-theme=green] .navigation__sub--active>a{
        color: #2196F3;
    }
    .sidebar{
        background: #ccc;
    }
    .btn{
        padding: .6rem .8rem;
    }
    .card-block{
        padding: 0;
    }
    .sidebar{
        width: 290px;
    }
    .toolbar{
        padding: .05rem 15px 0;
        background: #fff; 
          width: 360px; 
          height: 45px; 
          z-index: 999;
    } 
   /* .actions{
        width: 134px;
        height: 0px;
        margin-right: -5px;
        float: right;
    }*/
    .card-footer, .card-header{
        padding: 0;
    }
    .search{
      margin-right: 0;
    }
    .esri-ui-top-left{
      top: 75px;
      right: 0;
      display: none;
    }
    .btn:not(.btn-secondary):not([class*="btn-outline-"]):not(.btn-link){
      box-shadow: none;
    }
    /*jquery-ui*/
    .ui-widget.ui-widget-content{
      border:none;
      box-shadow: 0px 0px 8px 2px #C3E1F9;
      border-radius: 2px;
      color:rgba(51,51,51,1);
    }
    .ui-menu-item-wrapper{
      height: 30px;
      line-height: 20px;
      font-family: 微软雅黑;
      padding-left: 15px;
    }
    .ui-menu-item-wrapper:hover{
      border: 1px solid #C3E1F9;
      background: #C3E1F9;
      border: none;
      color: #2196F3;
    }
    .toolbar{
      height: 46px;
      line-height: 46px;
    }
    .toolbar:not(.toolbar--inner) {
      box-shadow: none;
      margin-bottom: 0;
    }
    .btn-group .btn + .btn, .btn-group .btn + .btn-group, .btn-group .btn-group + .btn, .btn-group .btn-group + .btn-group, .btn-group-vertical .btn + .btn, .btn-group-vertical .btn + .btn-group, .btn-group-vertical .btn-group + .btn, .btn-group-vertical .btn-group + .btn-group{
      margin-left: 4px;
    }
    .esriSimpleSliderIncrementButton,.esriSimpleSliderDecrementButton{
      display: none;
    }

    .mapDiv_root{
      height: 100%;
    }
    </style>
</head>
<body data-ma-theme="green">
 

<div class="form-group topBox">

    <div class="ui-widget searchDiv">
      <input id="tags" class="searchInput" placeholder="输入小区名关键词搜索小区" onfocus="this.placeholder=''" onblur="this.placeholder='输入小区名关键词搜索小区'">
      <div id="searchDiv">
        <asset:image src="search_4.png" class="searchImg"/>
      </div>
    </div>

    <div class="clearfix"></div>

    <div class="form-group evenly" style="margin-top: 15px; margin-bottom: 15px;">

      <div class="findHouse_1Box">
        <button type="button" class="btn btn-outline-primary waves-effect findHouse_1" id="areaSearchCommunity">区域找房</button>
        <input type="hidden" id="idValue"/>
          <input type="hidden" id="keyValue"/>
        <div class="allBox_1" >
            <!-- 一级菜单 -->
            <div class="areaFindHouse areaList" id="areaList"></div>
            <div class="areaFindArea" id="distList">
            </div>
      </div>
    </div>

      <div class="findHouse_2Box">
        <button type="button" class="btn btn-outline-primary waves-effect findHouse_2">焦点找房</button>
        <div class="allBox_2">
          <div class="focusFindHouse">
            <p class="studySchool">学区</p>
            <p class="businessArea">商圈</p>
            <p class="sight">景观</p>
          </div>
         <!--  <div class="focusFindArea">
            <p class="site">不限</p>
            <p class="site">小学</p>
            <p class="site">中学</p>
            <p class="site">大学</p>
          </div> -->
        </div>
      </div>

      <div class="findHouse_3Box">
        <button type="button" class="btn btn-outline-primary waves-effect findHouse_3">地铁找房</button>
          <div class="subwayFindHouse" id="ditieValue"></div>
          <input type="hidden" id="lineValue"/>
          <input type="hidden" id="stationValue"/>
        <div class="allBox_3">

          <div class="subwayFindLine">
            <div class="pull-left">
              <div class="site">
                <section class="subwayRadio"></section>
                <section class="subwayFont">中关村</section>
                <section class="verticalLine"></section>
              </div>

              <div class="site">
                <section class="subwayRadio"></section>
                <section class="subwayFont">国家图书馆</section>
                <section class="verticalLine"></section>
              </div>

              <div class="site">
                <section class="subwayRadio"></section>
                <section class="subwayFont">惠新西街南口站</section>
                <section class="verticalLine"></section>
              </div>

              <div class="site">
                <section class="subwayRadio"></section>
                <section class="subwayFont">大学</section>
                <section class="verticalLine"></section>
              </div>

              <div class="site">
                <section class="subwayRadio"></section>
                <section class="subwayFont">大学</section>
                <section class="verticalLine"></section>
              </div>

              <div class="site">
                <section class="subwayRadio"></section>
                <section class="subwayFont">大学</section>
              </div>

            </div>

            <div class="pull-left" style="margin-top: 20px;">
              <div class="site">
                <section class="subwayRadio"></section>
                <section class="subwayFont">中关村</section>
                <section class="verticalLine"></section>
              </div>

              <div class="site">
                <section class="subwayRadio"></section>
                <section class="subwayFont">国家图书馆</section>
                <section class="verticalLine"></section>
              </div>

              <div class="site">
                <section class="subwayRadio"></section>
                <section class="subwayFont">惠新西街南口站</section>
                <section class="verticalLine"></section>
              </div>

              <div class="site">
                <section class="subwayRadio"></section>
                <section class="subwayFont">大学</section>
                <section class="verticalLine"></section>
              </div>

              <div class="site">
                <section class="subwayRadio"></section>
                <section class="subwayFont">大学</section>
                <section class="verticalLine"></section>
              </div>

              <div class="site">
                <section class="subwayRadio"></section>
                <section class="subwayFont">大学</section>
              </div>

            </div>


          </div>
        </div>
      </div>

    </div>

 <div class="form-group evenly prevDiv">

    <div class="btn-group borderCss buttonClick_1">
      <div class="btn-primary typeofHouse">
          <div class="buttonClick_1Text">类型</div>
          <div class="sanjiaoDiv"><asset:image src="sanjiao_2.png"/></div>
      </div>
    </div>
    <div class="typeofSelect">
      <p>住宅</p>
      <p>商业</p>
      <p>办公</p>
      <p>工业</p>
    </div>


    <div class="btn-group borderCss buttonClick_2">
      <div class="btn-primary typeofHouse">
          <div class="buttonClick_2Text">建成年份</div>
          <div class="sanjiaoDiv"><asset:image src="sanjiao_2.png"/></div>
      </div>
    </div>
    <div class="averagePrice">
      <p>1970年以前</p>
      <p>1970-1980年</p>
      <p>1980-1990年</p>
      <p>1990-2000年</p>
      <p>2000-2010年</p>
      <p>2010年以后</p>
    </div>

    <div class="btn-group borderCss buttonClick_3">
        <div class="btn-primary typeofHouse">
          <div class="buttonClick_3Text">均价</div>
          <div class="sanjiaoDiv"><asset:image src="sanjiao_2.png"/></div>
        </div>
    </div>
    <div class="subwayDistance">
            <p>1万以下</p>
      <p>1-2万</p>
      <p>2-4万</p>
      <p>4-6万</p>
      <p>6-8万</p>
      <p>10万以上</p>
    </div>

  </div>

</div>

<!-- bottombox -->
<div class="form-group bottomBox">
  <div style="position: relative;">
    <div class="toolbar">
            <asset:image src="mapPosition.png" style="margin-left: -5px;"/>
            <span class="areaShow">北京</span>
            <span class="houseFontColor">共<span class="houseAccount"></span>个小区</span>
        <div class="actions" style="margin-right: -5px;">
            <p class="pull-left fontTab_1 fontColor">默认</p>
            <p class="pull-left firstArrow" style=""></p>
            <p class="pull-left fontTab_2">价格</p>
            <asset:image src="upArrow.png" class="priceArrow_1"/>
            <p class="pull-left secondArrow"></p>
            <asset:image src="upArrow.png" class="priceArrow_2"/>
            <p class="pull-left fontTab_3">年份</p>
        </div>
    </div>


    <div class="fold houseDetailBlock">
      <div class="houseDetail">
        <div class="houseBorder">
          <div class="pull-left houseBorderLeft">
            <asset:image src="january.jpg" width='100' height='90'/>
          </div>
          <div class="pull-left houseBorderRight">
            <div class="houseName">怡美家园111</div>
            <div class="houseDetailName">北京市海淀区知春路12号怡美家园小区</div>
            <div><span class="housePrice">100000</span><span class="houerArea">元 / 平</span>
            <button type="button" class="btn btn-outline-primary waves-effect pull-right searchDetail">查看详情</button>
          </div>
          </div>
        </div>
      </div>

      <div class="houseDetail">
        <div class="houseBorder">
          <div class="pull-left houseBorderLeft">
            <asset:image src="january.jpg" width='100' height='90'/>
          </div>
          <div class="pull-left houseBorderRight">
            <div class="houseName">怡美家园222</div>
            <div class="houseDetailName">北京市海淀区知春路12号怡美家园小区</div>
            <div><span class="housePrice">100000</span><span class="houerArea">元/平</span>
            <button type="button" class="btn btn-outline-primary waves-effect pull-right searchDetail">查看详情</button>
          </div>
          </div>
        </div>
      </div>

       <div class="houseDetail">
        <div class="houseBorder">
          <div class="pull-left houseBorderLeft">
            <asset:image src="january.jpg" width='100' height='90'/>
          </div>
          <div class="pull-left houseBorderRight">
            <div class="houseName">怡美家园222</div>
            <div class="houseDetailName">北京市海淀区知春路12号怡美家园小区</div>
            <div><span class="housePrice">100000</span><span class="houerArea">元/平</span>
            <button type="button" class="btn btn-outline-primary waves-effect pull-right searchDetail">查看详情</button>
          </div>
          </div>
        </div>
      </div>

       <div class="houseDetail">
        <div class="houseBorder">
          <div class="pull-left houseBorderLeft">
            <asset:image src="january.jpg" width='100' height='90'/>
          </div>
          <div class="pull-left houseBorderRight">
            <div class="houseName">怡美家园222</div>
            <div class="houseDetailName">北京市海淀区知春路12号怡美家园小区</div>
            <div><span class="housePrice">100000</span><span class="houerArea">元/平</span>
            <button type="button" class="btn btn-outline-primary waves-effect pull-right searchDetail">查看详情</button>
          </div>
          </div>
        </div>
      </div>

       <div class="houseDetail">
        <div class="houseBorder">
          <div class="pull-left houseBorderLeft">
            <asset:image src="january.jpg" width='100' height='90'/>
          </div>
          <div class="pull-left houseBorderRight">
            <div class="houseName">怡美家园222</div>
            <div class="houseDetailName">北京市海淀区知春路12号怡美家园小区</div>
            <div><span class="housePrice">100000</span><span class="houerArea">元/平</span>
            <button type="button" class="btn btn-outline-primary waves-effect pull-right searchDetail">查看详情</button>
          </div>
          </div>
        </div>
      </div>

      <div class="dashed"></div>

    </div>
      <!-- 分页器 -->
     <!--  <div class="btn-group flex pagings" >
          <g:paginate id="pageDevi ce" total="" params="" action="" controller="" max=""/>
          <g:paginate total="${tradeCount?: 0}" params="${params}"/>
      </div> -->


      <div class="trapezoid"><asset:image src="sanjiao_2.png" style="position: absolute; top: -15px;  left: 2px;"/></div>
    </div>
</div>


   <!-- 查询框 -->
 <!--  <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'right'" style="position: absolute; right: 0 ;top: 200px; z-index: 9;">     
      输入查询文本
      <input id="searchText" value="小学" type="text" />
      <input id="findBtn" type="button" value="查 找" />
      <div id="contentsContainer">1412</div>
  </div>        -->


  <!-- 加载arcgis地图 -->
  <div id="mapDiv" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'"></div>
  
<!-- 智慧楼盘js -->
<!-- <asset:javascript src="intelligence/jquery.min.js"/> -->
<asset:javascript src="intelligence/tether.min.js"/>
<asset:javascript src="intelligence/bootstrap.min.js"/>
<asset:javascript src="intelligence/waves.min.js"/>
<asset:javascript src="intelligence/jquery.scrollbar.min.js"/>
<asset:javascript src="intelligence/jquery-scrollLock.min.js"/>
<!-- <asset:javascript src="intelligence/waves.min.js"/> -->

<asset:javascript src="intelligence/jquery.flot.js"/>
<asset:javascript src="intelligence/jquery.flot.resize.js"/>
<asset:javascript src="intelligence/curvedLines.js"/>
<asset:javascript src="intelligence/jquery.vmap.min.js"/>
<asset:javascript src="intelligence/jquery.vmap.world.js"/>
<asset:javascript src="intelligence/jquery.easypiechart.min.js"/>
<asset:javascript src="intelligence/salvattore.min.js"/>
<asset:javascript src="intelligence/jquery.sparkline.min.js"/>
<asset:javascript src="intelligence/moment.min.js"/>
<asset:javascript src="intelligence/fullcalendar.min.js"/>
<asset:javascript src="intelligence/other-charts.js"/>
<asset:javascript src="intelligence/demo.js"/>
<asset:javascript src="intelligence/jqvmap.js"/>
<asset:javascript src="intelligence/flot-charts/curved-line.js"/>
<asset:javascript src="intelligence/flot-charts/line.js"/>
<asset:javascript src="intelligence/flot-charts/chart0-tolltips.js"/>
<asset:javascript src="intelligence/app.min.js"/>

<asset:javascript src="intelligence/jquery-ui.js"/>
<asset:javascript src="intelligence/index.js"/>

<script>
     $(function() {
    var availableTags = []
    $("#tags").keyup(function() {
      var inputValue = $("#tags").val();
      $.ajax({
          type: "post",
          url: "/community/queryCommunityList",
          data: {
            inputValue: inputValue
          },
          success: function (data) {
             if (data.status == "success") {
                console.log(data.communityList);
                availableTags = data.communityList
                console.log(availableTags);
                $( "#tags").autocomplete({
                  source: availableTags,
                  select: function(event, ui) {
                    $( "#tags").val(ui.item.value);
                    console.log(ui.item.key);
                    return false;
                  }
                });
                 $(".houseDetailBlock").html("");
                 var communityList = data.communityList;
                 $(".houseAccount").text(data.communityCount)
                 var param=data.params
                 var communityCount=data.communityCount
                 var purl="";
                 for (var i = 0; i < communityList.length; i++)
                 {
                     console.log(i)
                     var content = "";
                     purl = getPicture(communityList[i].id)
                     content += '<div class="houseDetail">';
                     content += '<div class="houseBorder">';
                     content += '<div class="pull-left houseBorderLeft">';
                     content += '<div id="commPicture"><image src=" ' + purl + '" width=100 height=90 onerror="javascript:this.src=\'/assets/january.jpg\'"/></div>';
                     content += '</div>';
                     content += '<div class="pull-left houseBorderRight">';
                     content += '<div class="houseName">' + communityList[i].communityname + '</div>';
                     content += '<div class="houseDetailName">' + communityList[i].detailaddress + '</div>';
                     content += '<div><span class="housePrice">' + communityList[i].currentapplicationprice + '</span><span class="houerArea">元/平</span>';
                     content += '<span><input type="hidden" value=' + communityList[i].buildyear + '></span>';
                     content += '<a type="button" class="btn btn-outline-primary waves-effect pull-right searchDetail" href="/community/show/' + communityList[i].id + '">查看详情</a>';
                     content += '</div>';
                     content += '</div>';
                     content += '</div>';
                     content += '</div>';
                     $(".houseDetailBlock").append(content);
                 }

                 %{--var paging =""--}%
                 %{--paging += '<div class="btn-group flex pagings">aaaaaaaaaaaaaaaaaa';--}%
                 %{--paging += '<g:paginate total='+communityCount+' params="param"/>';--}%
                 %{--paging += '</div>';--}%
                 %{--$(".houseDetailBlock").append(paging);--}%
             }
          }
      })

      $( "#tags").autocomplete({
        source: availableTags,
        select: function(event, ui) {
          $( "#tags").val(ui.item.value);
          console.log(ui.item.key);
          return false;
        }
      });
    })
  })

  </script>


<script>
    
    function getPicture( communityId) {
        var purl = ""
        $.ajax({
            type: "post",
            async: false,
            url: "/picture/searchPicture",
            data: {addressId: communityId},
            success: function (data) {
                var pictureList=data.pictureList
                var length=pictureList.length
//                console.log("-===="+pictureList.length)
                if(length==0){
                    purl="/assets/january.jpg"
                }else{
                   purl=pictureList[0][3]
                }
            }
        });
        return purl

    }

    var cityId=2;
    $(function () {
        var childArea = [];
        $(".findHouse_1").mouseover(function(){
            $.ajax({
                type: "post",
                url: "/area/searchAllArea",
                data: {cityId: cityId},
                success: function (data) {
                    var areaList = data.areaList;
                    var area = "";
                    var all=[{"id":1,  NAME:"不限"}];
                    childArea.push(all);
                    area += "<p class='childA' childArea=0>不限</p>";
                    var htm=""
                    var length = areaList.length;
                    for(var j=0;j<length;j++){
                        var x = areaList[j]
                        for(var key in x){
                            var y = j+1;
                            var aa=key.split("{");
                            var bb=aa[1].split("}")
                            var ss = bb[0].split("=");
                            area += "<p class='childA' childArea="+y+">"+ss[1]+"</p><input type='hidden' value="+ss[0]+">";
                            $(".areaFindHouse").css("height",(length+1)*30+"px");
                            $("#areaList").html(area);
                            $(".childA").click(function(e){
                                $(".findHouse_1").html($(this).text());
                                $("#keyValue").val($(this).next().val());
                               searchCommunity();
                            })
                            childArea.push(x[key]);
                        }
                    }

                    addLiClass();

                }
            });
        });
        function addLiClass(){

            $(".childA").addClass("areaunselect");
            $(".childA").bind("mouseover",function(){

                $(".childA").addClass("areaunselect");
                $(".childAi").removeClass("areaselect");
                var li = $(this);
                li.removeClass("areaunselect");
                li.addClass("areaselect");
                var childA = childArea[li.attr("childArea")];
                var length = childA.length;
                var htm="";
                if (length!=0) {
                    for (var i = 1; i <= length; i++) {
                        if (childA[i - 1][0] == undefined) {
                            htm += ""
                        }
                        else {

                            if (i <= (length / 2)) {
                                htm += "<div>"
                                htm += "<p class='buttonClickAreaname site'>" + childA[i - 1][0] + "</p><span class='buttonClickAreaid'><input type='hidden' value=" + childA[i - 1][1] + " /></span>"
                                htm += "</div>"
                            }
                            else {
                                htm += "<div>"
                                htm += "<p class='buttonClickAreaname site'>" + childA[i - 1][0] + "</p><span class='buttonClickAreaid'><input type='hidden' value=" + childA[i - 1][1] + " /></span>"
                                htm += "</div>"
                            }
                    }
                        $(".areaFindArea").css("height",(length/3)*30+"px");
                        // htm+="<tr><td class='buttonClickAreaname'><a href='' params='[areaId:" + childA[i - 1][1] +" '><button >"+childA[i - 1][0]+"</button></a></td></tr>"
                        $("#distList").html(htm);
                        $("#distList").show();
                         $(".buttonClickAreaname").click(function(){
                            $(".findHouse_1").html($(this).text())
                            $("#idValue").val($(this).next().children("input").val());
                            searchCommunity();
                         })
                    }
                }
            });
        }

    });

    var childArea = [];
$(".findHouse_3").mouseover(function () {
    $.ajax({
        type: "post",
        url: "/subway/searchSubway",
        data: {cityId: cityId},
        success: function (data) {
            var subwayList=data.subwayList
            var ditieArea=""
            var i=0;
            for(var key in subwayList){
                var aa=key.split("{");
                var bb=aa[1].split("}")
                var ss = bb[0].split("=");
                ditieArea += "<p class='childA' childArea="+i+">"+ss[1]+"</p><input type='hidden' value="+ss[0]+">";
                i++
                $(".subwayFindHouse").css("height",(i)*30+"px");
                $("#ditieValue").html(ditieArea)

                $(".childA").click(function(e){
                        $(".findHouse_3").html($(this).text());
                        $("#lineValue").val($(this).next().val());
                });
                childArea.push(subwayList[key])
            }
            addStation();
        }
    });
});
    function addStation(){

        $(".childA").addClass("areaunselect");
        $(".childA").bind("mouseover",function(){
            $(".childA").addClass("areaunselect");
            $(".childAi").removeClass("areaselect");
            var p = $(this);
            p.removeClass("areaunselect");
            p.addClass("areaselect");
            var childA = childArea[p.attr("childArea")];
            var length = childA.length;
            var htm="";
            if (length!=0) {
                for (var i = 1; i <= length; i++) {
                    if(i<=(length/2)) {
                        if(i==1){
                            htm += "<div class='pull-left'>"
                            htm += "<div class='site'>"
                            htm += "<section class='subwayRadio'></section>"
                            htm += "<section class='buttonClickAreaname site subwayFont'>" + childA[i - 1][3] + "</section><span class='buttonClickAreaid'><input type='hidden' value=" + childA[i - 1][2] + " /></span>"
                            htm += "<section class='verticalLine'</section>"
                            htm+="</div>"
                            htm+="</div>"
                        }else {
                            htm += "<div class='pull-left'>"
                            htm += "<div class='site'>"
                            htm += "<section class='subwayRadio'></section>"
                            htm += "<section class='buttonClickAreaname site subwayFont'>" + childA[i - 1][3] + "</section><span class='buttonClickAreaid'><input type='hidden' value=" + childA[i - 1][2] + " /></span>"
                            htm += "<section class='verticalLine'</section>"
                            htm += "</div>"
                            htm += "</div>"
                        }
                    }
                    else{
                        htm += "<div class='pull-left'>"
                        htm += "<div class='site'>"
                        htm += "<section class='subwayRadio'></section>"
                        htm += "<section class='buttonClickAreaname site subwayFont'>" + childA[i - 1][3] + "</section><span class='buttonClickAreaid'><input type='hidden' value=" + childA[i - 1][2] + " /></span>"
                        htm += "<section class='verticalLine'</section>"
                        htm+="</div>"
                        htm+="</div>"
                    }
//                    $(".subwayFindLine").css("height", length * 30 + "px");
                    // htm+="<tr><td class='buttonClickAreaname'><a href='' params='[areaId:" + childA[i - 1][1] +" '><button >"+childA[i - 1][0]+"</button></a></td></tr>"
                    $(".subwayFindLine").html(htm);
                    $(".subwayFindLine").show();
                    $(".buttonClickAreaname").click(function () {
                        $(".findHouse_3").html($(this).text())
                        $("#stationValue").val($(this).next().children("input").val());

                    })
                }
            }
        });
    }




function searchCommunity(){
   var year=$(".buttonClick_2Text").text().split("年")
    $.ajax({
        type: "post",
        url: "/community/searchCommunity",
        data: {
          residentialtype: $(".buttonClick_1Text").text(),
          buildingyear:year[0],
          currentapplicationprice: $(".buttonClick_3Text").text(),
          areaId:$("#keyValue").val(),
          precinctId:$("#idValue").val(),
        },
        success: function (data) {
          if (data.status == "success") {
            $(".houseDetailBlock").html("");

            var communityList = data.communityList;
            $(".houseAccount").text(data.communityCount)
              var param=data.params
              var communityCount=data.communityCount
              console.log("communityCount=="+communityCount)
              console.log("para=="+'${params}')
              var purl="";
              var countPage=""

              console.log("countPage==="+countPage)
            for (var i = 0; i < communityList.length; i++)
            {
                console.log(i)
                var content = "";
                purl = getPicture(communityList[i].id)
               content += '<div class="houseDetail">';
               content += '<div class="houseBorder">';
               content += '<div class="pull-left houseBorderLeft">';
               content += '<div id="commPicture"><image src=" ' + purl + '" width=100 height=90 onerror="javascript:this.src=\'/assets/january.jpg\'"/></div>';
               content += '</div>';
               content += '<div class="pull-left houseBorderRight">';
               content += '<div class="houseName">' + communityList[i].communityname + '</div>';
               content += '<div class="houseDetailName">' + communityList[i].detailaddress + '</div>';
               content += '<div><span class="housePrice">' + communityList[i].currentapplicationprice + '</span><span class="houerArea">元/平</span>';
               content += '<span><input type="hidden" value=' + communityList[i].buildyear + '></span>';
               content += '<a type="button" class="btn btn-outline-primary waves-effect pull-right searchDetail" href="/community/show/' + communityList[i].id + '">查看详情</a>';
               content += '</div>';
               content += '</div>';
               content += '</div>';
               content += '</div>';
               $(".houseDetailBlock").append(content);
                searchDetail(communityList[i].id)
            }
            %{--var paging =""--}%
              %{--paging += '<div class="btn-group flex pagings">aaaaaaaaaaaaaaaaaa';--}%
              %{--paging += '<g:paginate total="'+15+'" params="param"/>';--}%
              %{--paging += '</div>';--}%
              %{--$(".houseDetailBlock").append(paging);--}%
              $("#pageDevice").attr('total','communityCount');
              $("#pageDevice").attr('controller','community');
              $("#pageDevice").attr('action','searchCommunity');
              $("#pageDevice").attr('max','10');

          }
        },
        error: function () {
          alert("获取失败，请稍后重试");
            //  swal("获取失败，请稍后重试", "", "error");
      },
    });
}

function  searchDetail(communityId) {
    console.log("sthshsh======"+communityId)
    $.ajax({
        type: "post",
        async: false,
        url: "/community/searchDetailCount",
        data: {communityId: communityId},
        success: function (data) {
            console.log("detail===="+data.status)

        }
    });
}
function searchSchool() {
    var focusType=$(".findHouse_2").text()

    $.ajax({
        type: "post",
        url: "/education/searchSchool",
        data:{areaId: cityId},
        success: function (data) {
            if (data.status == "success") {
                $(".houseDetailBlock").html("");
                var content = "";
                var allSchoolList = data.allSchoolList;
                $(".houseAccount").text(data.schoolCount)
                for (var i = 0; i < allSchoolList.length; i++)
                {
                    content += '<div class="houseDetail">';
                    content += '<div class="houseBorder">';
                    content += '<div class="pull-left houseBorderLeft">';
                    content += '<asset:image src="january.jpg" width='100' height='90'/>';
                    content += '</div>';
                    content += '<div class="pull-left houseBorderRight">';
                    content += '<div class="houseName">' + allSchoolList[i].name + '</div>';
                    content += '<div class="houseDetailName">' + allSchoolList[i].address + '</div>';
                    content += '<div><span class="housePrice">' + allSchoolList[i].avgerageBuildingPrice + '</span><span class="houerArea">元/平</span>';
//                    content += '<button type="button" class="btn btn-outline-primary waves-effect pull-right searchDetail">查看详情</button>';
                    content += '</div>';
                    content += '</div>';
                    content += '</div>';
                    content += '</div>';
                    $(".houseDetailBlock").append(content);

                }
            }

        },
        error: function () {
            alert("获取失败，请稍后重试");

        },
    });

}
    function searchBusinessArea() {

        var focusType=$(".findHouse_2").text()
        $.ajax({
            type: "post",
            url: "/trading/searchBusinessArea",
            data: {areaid: cityId},
            success: function (data) {
                if (data.status == "success") {
                    $(".houseDetailBlock").html("");
                    var content = "";
                    var allTradingList = data.allTradingList;
                    $(".houseAccount").text(data.tradingCount)
                    for (var i = 0; i < allTradingList.length; i++)
                    {
                        content += '<div class="houseDetail">';
                        content += '<div class="houseBorder">';
                        content += '<div class="pull-left houseBorderLeft">';
                        content += '<asset:image src="january.jpg" width='100' height='90'/>';
                        content += '</div>';
                        content += '<div class="pull-left houseBorderRight">';
                        content += '<div class="houseName">' + allTradingList[i].name + '</div>';
                        content += '<div class="houseDetailName">' + allTradingList[i].address + '</div>';
                        content += '<div><span class="housePrice">' + allTradingList[i].avgerageBuildingPrice + '</span><span class="houerArea">元/平</span>';
//                    content += '<button type="button" class="btn btn-outline-primary waves-effect pull-right searchDetail">查看详情</button>';
                        content += '</div>';
                        content += '</div>';
                        content += '</div>';
                        content += '</div>';
                        $(".houseDetailBlock").append(content);

                    }
                }

            },
            error: function () {
                alert("获取失败，请稍后重试");

            },
        });

    }
    function searchScenery() {
        var focusType=$(".findHouse_2").text()
        $.ajax({
            type: "post",
            url: "/scenery/searchScenery",
            data: {areaId: cityId},
            success: function (data) {
                if (data.status == "success") {
                    $(".houseDetailBlock").html("");
                    var content = "";
                    var allSceneryList = data.allSceneryList;
                    $(".houseAccount").text(data.sceneryCount)
                    for (var i = 0; i < allSceneryList.length; i++)
                    {
                        content += '<div class="houseDetail">';
                        content += '<div class="houseBorder">';
                        content += '<div class="pull-left houseBorderLeft">';
                        content += '<asset:image src="january.jpg" width='100' height='90'/>';
                        content += '</div>';
                        content += '<div class="pull-left houseBorderRight">';
                        content += '<div class="houseName">' + allSceneryList[i].name + '</div>';
                        content += '<div class="houseDetailName">' + allSceneryList[i].address + '</div>';
                        content += '<div><span class="housePrice">' + allSceneryList[i].avgerageBuildingPrice + '</span><span class="houerArea">元/平</span>';
//                    content += '<button type="button" class="btn btn-outline-primary waves-effect pull-right searchDetail">查看详情</button>';
                        content += '</div>';
                        content += '</div>';
                        content += '</div>';
                        content += '</div>';
                        $(".houseDetailBlock").append(content);

                    }
                }

            },
            error: function () {
                alert("获取失败，请稍后重试");
                //  swal("获取失败，请稍后重试", "", "error");
            },
        });

    }

    // 分页器样式
    $(".pagings>a,.pagings>span").addClass("btn btn-secondary waves-effect");
    // 当前分页
    $(".currentStep").css({"background":"#2196F3","color":"#fff","border-color":"#2196F3"});
</script>

</body>
</html>
